package com.example.service;

import com.example.entity.Address;
import com.example.mapper.AddressMapper;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class AddressService {
    @Resource private AddressMapper addressMapper;

    public List<Address> selectAll() {
        return addressMapper.selectAll();
    }

    public List<Address> selectByUser(Integer userId) {
        return addressMapper.selectByUser(userId);
    }

    public void AddAddress(Address address) {
        addressMapper.addAddress(address);
    }

    public void deleteAddressById(Integer id) {
        addressMapper.deleteAddressById(id);
    }
}
